package com.it.arktech;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.it.arktech.model.Member;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {
	private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
	/**
	 * Simply selects the home view to render by returning its name.
	 */
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home(Locale locale, Model model, HttpSession session) {
		logger.info("Welcome index! The client locale is {}.", locale);
		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
		String formattedDate = dateFormat.format(date);
		model.addAttribute("serverTime", formattedDate );
		return "index";
	}
	@RequestMapping(value = "/index", method = RequestMethod.GET)
	public String index(Locale locale, Model model, HttpSession session) {	
		logger.info("Welcome home! The client locale is {}.", locale);
		return "index";
	}
	@RequestMapping(value = "/about-us", method = RequestMethod.GET)
	public String about(Locale locale, Model model) {
		logger.info("About-us Page! The client locale is {}.", locale);
		return "about-us";
	}
	@RequestMapping(value = "/services", method = RequestMethod.GET)
	public String service(Locale locale, Model model) {
		logger.info("Services Page! The client locale is {}.", locale);
		return "services";
	}
	@RequestMapping(value = "/portfolio", method = RequestMethod.GET)
	public String portfolio(Locale locale, Model model) {
		logger.info("Portfolio Page! The client locale is {}.", locale);
		return "portfolio";
	}
	@RequestMapping(value = "/career", method = RequestMethod.GET)
	public String career(Locale locale, Model model) {
		logger.info("Career Page! The client locale is {}.", locale);
		return "career";
	}
	@RequestMapping(value = "/blog-item", method = RequestMethod.GET)
	public String blogItem(Locale locale, Model model) {
		logger.info("Blog-item Page! The client locale is {}.", locale);
		return "blog-item";
	}
	@RequestMapping(value = "/faq", method = RequestMethod.GET)
	public String faq(Locale locale, Model model) {
		logger.info("Faq Page! The client locale is {}.", locale);
		return "faq";
	}
	@RequestMapping(value = "/pricing", method = RequestMethod.GET)
	public String pricing(Locale locale, Model model) {
		logger.info("Pricing Page! The client locale is {}.", locale);
		return "pricing";
	}
	@RequestMapping(value = "/404", method = RequestMethod.GET)
	public String error(Locale locale, Model model) {
		logger.info("404 Page! The client locale is {}.", locale);
		return "404";
	}
	@RequestMapping(value = "/typography", method = RequestMethod.GET)
	public String typography(Locale locale, Model model) {
		logger.info("Typography Page! The client locale is {}.", locale);
		return "typography";
	}
	@RequestMapping(value = "/registration", method = RequestMethod.GET)
	public String registration(Locale locale, Model model) {
		logger.info("Registration Page! The client locale is {}.", locale);
		return "registration";
	}
	@RequestMapping(value = "/privacy", method = RequestMethod.GET)
	public String privacy(Locale locale, Model model) {
		logger.info("Privacy Page! The client locale is {}.", locale);
		return "privacy";
	}
	@RequestMapping(value = "/terms", method = RequestMethod.GET)
	public String terms(Locale locale, Model model) {
		logger.info("Terms Page! The client locale is {}.", locale);
		return "terms";
	}
	@RequestMapping(value = "/blog", method = RequestMethod.GET)
	public String blog(Locale locale, Model model) {
		logger.info("Blog Page! The client locale is {}.", locale);
		return "blog";
	}
	@RequestMapping(value = "/contact-us", method = RequestMethod.GET)
	public String contactUs(Locale locale, Model model) {
		logger.info("Contact-us Page! The client locale is {}.", locale);
		return "contact-us";
	}
	
	
}
